package com.baidu.mapper;

import com.baidu.model.pojo.User;
import com.baidu.model.vo.UserQueryVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    @Select("select * from t_user")
    List<User> findAll();

    @Select("select * from t_user where email=#{email}")
    User findByEmail(String email);

    @Select("select * from t_user where email=#{email} or power=#{power}")
    User findByEmailOrPower(@Param("email") String email,@Param("power") int power);

    @Select("select * from t_user where email=#{email} or power=#{power}")
    User findByVo(UserQueryVo vo);

    @Select("SELECT count(*) FROM t_user where power=#{power}")
    User findCountByPower(int power);
}
